<%--
  Created by IntelliJ IDEA.
  User: DELL
  Date: 2021/4/14
  Time: 8:57
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>海尔官网|用户编辑</title>
    <link rel="stylesheet" type="text/css" href="css/bootstrap.css"/>
    <script type="text/javascript" src="js/jquery.min.js"></script>
    <script type="text/javascript" src="js/bootstrap.js"></script>
    <link rel="stylesheet" type="text/css" href="icon/iconfont.css"/>
    <link rel="stylesheet" type="text/css" href="css/index.css"/>
</head>
<body>
<div class="container">
    <div class="row" style=" padding: 10px;padding-left: 0px;">
        <div class="col-md-1" style="padding: 10px; ">
            <a href="index.jsp"><img src="img/haier2020_logo.webp" width="80px" height="45px"></img></a>
        </div>
        <div class="col-md-5" style="padding: 2px;">
            <ul class="nav navbar-nav">
                <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true"
                       aria-expanded="false"
                       style="color: #000000;"><strong>智慧家庭</strong>
                        <span class="caret"></span></a>
                    <ul class="dropdown-menu">
                        <li><a href="#">电视</a></li>
                        <li><a href="#">冰柜</a></li>
                        <li><a href="#">洗衣机</a></li>
                        <li><a href="#">空调</a></li>
                    </ul>
                </li>
            </ul>
            <ul class="nav navbar-nav">
                <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true"
                       aria-expanded="false"
                       style="color: #000000;"><strong>商用解决方案</strong>
                        <span class="caret"></span></a>
                    <ul class="dropdown-menu">
                        <li><a href="U-home.html">U-home</a></li>
                        <li><a href="#">商用冷柜</a></li>
                        <li><a href="#">商用电视</a></li>
                    </ul>
                </li>
            </ul>
            <ul class="nav navbar-nav">
                <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true"
                       aria-expanded="false"
                       style="color: #000000;"><strong>购买与服务</strong>
                        <span class="caret"></span></a>
                    <ul class="dropdown-menu">
                        <li><a href="page">会员才可以点</a></li>
                        <li><a href="#">你不可以</a></li>
                    </ul>
                </li>
            </ul>
            <ul class="nav navbar-nav">
                <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true"
                       aria-expanded="false"
                       style="color: #000000;"><strong>关于海尔</strong>
                        <span class="caret"></span></a>
                    <ul class="dropdown-menu">
                        <li><a href="about.html">海尔品牌</a></li>
                        <li><a href="#">投资者关系</a></li>
                        <li><a href="#">品牌资讯</a></li>
                    </ul>
                </li>
            </ul>
        </div>
        <div class="col-md-offset-2 col-md-2" style="padding: 2px;text-align: right; margin-top: 15px;">
            <a href="shopcar.jsp"><span class="glyphicon glyphicon-shopping-cart" aria-hidden="true"
                                        style="font-size: 25px;color: #000000;"></span></a>
        </div>
        <div id="headtext" ; class="col-md-2" style="padding: 2px;text-align: center;margin-top: 15px;">
            <c:if test="${!empty userLogin}">
                <a style="text-decoration: none" href="log_in.jsp"><span class="glyphicon glyphicon-user"
                                                                         aria-hidden="true"
                                                                         style="font-size: 25px;color: #000000;"></span>&nbsp;&nbsp;&nbsp;&nbsp;</a><span
                    style="color: #e4b9b9; font-size:large">${userLogin.username}</span>&nbsp;&nbsp;&nbsp;<a style="text-decoration: none" href="logOut">退出</a>
            </c:if>
<%--            <c:if test="${empty userLogin}">--%>
<%--                <a href="log_in.jsp"><span class="glyphicon glyphicon-user" aria-hidden="true"--%>
<%--                                           style="font-size: 25px;color: #000000;">&nbsp;</span></a>--%>
<%--            </c:if>--%>
        </div>
    </div>
</div>

<form class="form-horizontal" method="post" action="update">
    <div class="form-group">
        <input type="hidden" name="count" value="${count}">
        <label for="username1" class="col-sm-2 control-label">用户名</label>
        <div class="col-sm-10">
            <input type="text" class="form-control" name="username" id="username1" value="${user.username}">
        </div>
    </div>
    <div class="form-group">
        <label for="password1" class="col-sm-2 control-label">密码</label>
        <div class="col-sm-10">

            <input type="password" class="form-control" name="password" id="password1"  value="${user.password}">
            <span id="demo1" class="glyphicon glyphicon-eye-close" onclick="hideShowPsw()" aria-hidden="true"></span>
        </div>

    </div>
    <div class="form-group">
        <div class="col-sm-offset-2 col-sm-10">
            <button type="submit" class="btn btn-default">确认</button>
        </div>
    </div>
</form>

</body>

<script type="text/javascript">
    // 这里使用最原始的js语法实现，可对应换成jquery语法进行逻辑控制
    var demoImg = document.getElementById("demo1");
    var demoInput = document.getElementById("password1");
    //隐藏text block，显示password block
    function hideShowPsw(){
        if (demoInput.type == "password") {
            demoInput.type = "text";
            demoImg.className = "glyphicon glyphicon-eye-open";
        }else {
            demoInput.type = "password";
            demoImg.className = "glyphicon glyphicon-eye-close";
        }
    }
</script>
</html>
